import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '付款标题',
    align: "center", resizable: true,
    dataIndex: 'title'
  },
  {
    title: '项目',
    align: "center", resizable: true,
    dataIndex: 'projectId_dictText'
  },
  {
    title: '子项目',
    align: "center", resizable: true,
    dataIndex: 'subProjectId_dictText'
  },
  {
    title: '分包商',
    align: "center", resizable: true,
    dataIndex: 'contractorId_dictText'
  },

  {
    title: '关联收票登记',
    align: "center", resizable: true,
    dataIndex: 'invoiceId',
    width:200,
    customRender:({text}) =>{
      return text ? text.split(",") : [];
    },
  },

  {
    title: '打款日期',
    align: "center", resizable: true,
    dataIndex: 'paymentDate',
    customRender:({text}) =>{
      text = !text ? "" : (text.length > 10 ? text.substr(0,10) : text);
      return text;
    },
  },
  {
    title: '本次打款金额',
    align: "center", resizable: true,
    dataIndex: 'paymentAmount'
  },
  {
    title: '付款方式',
    align: "center", resizable: true,
    dataIndex: 'paymentMethods_dictText'
  },
  {
    title: '付款凭证',
    align: "center", resizable: true,
    dataIndex: 'paymentAffix',
  },/*  {
    title: '付款类型',
    align: "center", resizable: true,
    dataIndex: 'paymentType_dictText'
  },
  {
    title: '银行名称',
    align: "center", resizable: true,
    dataIndex: 'bankName'
  },
  {
    title: '开户行',
    align: "center", resizable: true,
    dataIndex: 'branchName'
  },
  {
    title: '银行卡号',
    align: "center", resizable: true,
    dataIndex: 'accountNumber'
  },
  {
    title: '开户人名称',
    align: "center", resizable: true,
    dataIndex: 'accountHolderName'
  },*/

];

// 高级查询数据
export const superQuerySchema = {
  projectId: {title: '项目',order: 0,view: 'list', type: 'string',dictTable: "c_project_application", dictCode: 'id', dictText: 'project_name',},
  subProjectId: {title: '子项目',order: 1,view: 'list', type: 'string',dictTable: "c_sub_project", dictCode: 'id', dictText: 'sub_project_name',},
  contractorId: {title: '分包商ID',order: 2,view: 'list', type: 'string',dictTable: "c_contractor_info", dictCode: 'id', dictText: 'contact_name',},
  paymentDate: {title: '打款日期',order: 3,view: 'date', type: 'string',},
  paymentAmount: {title: '本次打款金额',order: 4,view: 'number', type: 'number',},
  paymentMethods: {title: '付款方式',order: 5,view: 'list', type: 'string',dictCode: 'payment_methods',},
  paymentAffix: {title: '付款凭证',order: 6,view: 'file', type: 'string',},
  paymentType: {title: '付款类型',order: 7,view: 'list', type: 'string',dictCode: 'payment_type',},
  bankName: {title: '银行名称',order: 9,view: 'text', type: 'string',},
  branchName: {title: '开户行',order: 10,view: 'text', type: 'string',},
  accountNumber: {title: '银行卡号',order: 11,view: 'text', type: 'string',},
  accountHolderName: {title: '开户人名称',order: 12,view: 'text', type: 'string',},
};
